#include <QFile>
#include <QDebug>
#include <QIODevice>
#include <QTextStream>
#include "res_helper.h"

ResHelper::ResHelper(const char *fileName) {
    QFile file(fileName);
    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
        exit(1);
    }
    QTextStream in(&file);
    QStringList strs;
    while (!in.atEnd()) {
        // 逐行读取
        QString line = in.readLine(); 
        strs.append(line);
    }
    file.close();

    content = strs.join("\n");
}
